const mysql = require('../../node_modules/mysql');
let config = {
    "host":'192.168.111.144',
    "user":"root",
    "password":"ddd",
    "database":"mydatabase"
}
let con = mysql.createConnection(config);
con.connect();

let obj = {};
obj.query = async function (sqltext,arr) {
    return await new Promise((resolve , reject) => {
        con.query(sqltext,arr,(e , data) => {
            if (e) {
                reject(e)
            }
            else{
                resolve(data)
            }
        })
    })
}
module.exports=obj;